<script type="text/javascript">
$(function(){
	var pg = App.soagov.faceImplPicker.ui, pp = pg.params,
		catalogLb = pg.children('.head').seek('title'),
		key = pg.seek('key');

	var gd = pg.find('.grid').mac('grid', {
		key: 'id',
		cols : [{
			field: 'impl',title: '已知实现类', width: 320,
		}, {
			field: 'ver', title : '版本', width: 120
		},{
			field: 'id', title : '操作', width: 60,
			render: function(r, tr, gd) {
				var p = $('<div></div>'),st = '<span class="a"></span>';
					$(st).click(function(){
						mac.confirm('确定要 删除 实现类 ' + r.impl + ' 吗？', function(){
							$.post(App.ctx + '/face/impl/delete.do', {
								id: r.id
							}, function(rs){
								var ro = mac.eval(rs);
								if (ro.success) {
									gd.load();
								} else {
									mac.alert(ro.data, ro.params);
								}
							});
						});
						return false;
					}).append('删除').appendTo(p);
				return p;
			}
		}],		
		loader: {
			url: App.ctx + '/face/impl/list.do',
			params: {
				pageNo: 1, pageSize: 7,faceId:pp.faceId
			},
			autoLoad: true
		},
		pagerLength: 7
	});
	function adjust(){
		var h = pg.parent().height();
		gd.parent().height('290');
		gd.adjust();
	}
	$(window).resize(adjust);
	adjust();
	
	pg.seek('key').keydown(function(e) {
		if (e.keyCode == 13)
			gd.load({ faceId:pp.faceId,key : key.val()});
	});
	
	pg.seek('srchBtn').click(function(e) {
		gd.load({ faceId:pp.faceId,key : key.val()});
	});
	
	pg.seek('close').click(function(){
		pg.close();
	});
});
</script>

<div class="head">
	关键字：<input type="text" name="key" />
	<button name="srchBtn">查找</button>
</div>
<div class="body">
	<div class="grid"></div>
</div>
<div class="bottom">
	<button name="close">关闭</button>
</div>